package jmine.tec.proxy;

import jmine.tec.proxy.chain.ChainElement;
import jmine.tec.proxy.chain.InvocationChain;

public class MyChainElement implements ChainElement {

    public static final String retString = "someString";

    public static final Integer value = new Integer(Integer.MAX_VALUE);

    public Object aroundInvoke(InvocationChain chain) throws Throwable {
        if(chain.getInvokingMethod().getName().equals("string")) {
            return retString;
        } else if(chain.getInvokingMethod().getName().equals("integer")) {
            return value;
        }
        return chain.proceed();
    }
}
